package com.yh.dao;


import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

public interface RolePermissionDao {

    @Delete("delete from role_permission where roleId=#{rid}")
    int deleteByRid(int rid);

    @Insert("<script>" +
            "        insert into role_permission (roleId ,permissionId) values\n" +
            "        <foreach collection=\"ids\" item=\"i\" separator=\",\">\n" +
            "            (#{rid},#{i})\n" +
            "        </foreach>\n" +
            "</script>")
    int insertArr(@Param("rid") int rid, @Param("ids") int[] ids);

}
